package krow.dev.gunpobus.model;

import krow.dev.gunpobus.R;
import krow.dev.gunpobus.Constants.Value;

public class FavoriteItem {

	private String mId;

	private String mName;

	private String mStationSerial;

	private int mType;

	private int mRouteType;

	private int mIcon;
	
	public String getId() {
		return mId;
	}

	public void setId(String id) {
		mId = id;
	}

	public String getName() {
		return mName;
	}

	public void setName(String name) {
		mName = name;
	}

	public String getStationSerial() {
		return mStationSerial;
	}

	public void setStationSerial(String stationSerial) {
		mStationSerial = stationSerial;
	}

	public int getType() {
		return mType;
	}

	public void setType(int type) {
		mType = type;
	}

	public int getRouteType() {
		return mRouteType;
	}

	public void setRouteType(int routeType) {
		mRouteType = routeType;
		mIcon = getResourceId(routeType);
	}
	
	public int getIcon() {
		return mIcon;
	}
	
	private static int getResourceId(int type) {
		
		int resourceId = R.drawable.icon_bus_blue;
		
		switch (type) {
		case Value.TYPE_ROUTE_SEAT:
			resourceId = R.drawable.icon_bus_blue;
			break;
		case Value.TYPE_ROUTE_VILLAGE:
			resourceId = R.drawable.icon_bus_yellow;
			break;
		case Value.TYPE_ROUTE_DIRECT:
			resourceId = R.drawable.icon_bus_red;
			break;
		case Value.TYPE_ROUTE_GENERAL:
			resourceId = R.drawable.icon_bus_green;
			break;
		}
		
		return resourceId;
	}

}
